package model

type UserAddress struct {
	AddressID     uint   `json:"addressId" gorm:"type:bigint;primary_key;not null;autoIncrement"`
	UserID        uint   `json:"userId" gorm:"type:bigint;not null"`
	UserName      string `json:"userName" gorm:"type:varchar(30);not null"`
	UserPhone     string `json:"userPhone" gorm:"type:varchar(11);not null"`
	DefaultFlag   uint   `json:"defaultFlag" gorm:"type:tinyint;not null"`
	ProvinceName  string `json:"provinceName" gorm:"type:varchar(32);not null"`
	CityName      string `json:"cityName" gorm:"type:varchar(32);not null"`
	RegionName    string `json:"regionName" gorm:"type:varchar(32);not null"`
	DetailAddress string `json:"detailAddress" gorm:"type:varchar(64);not null"`
	IsDeleted     uint   `json:"isDeleted" gorm:"type:tinyint;not null"`
	CreateTime    Time   `json:"createTime" gorm:"type:datetime;not null;default:current_timestamp"`
	UpdateTime    Time   `json:"updateTime" gorm:"type:datetime;not null;default:current_timestamp"`
}

// TableName 自定义表明，不适用默认的mall_users
func (receiver UserAddress) TableName() string {
	return "tb_newbee_mall_user_address"
}
